﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LiteFw
{
    public class DataType
    {
        public static T To<T>(object value)
        {
            if (value == null || Convert.IsDBNull(value))
                return default(T);
            if (value is T)
                return (T)value;
            return (T)Convert.ChangeType(value, typeof(T));
        }
    }
}
